package cn.tyf.controller;

import cn.tyf.common.ConstAutoConfig;
import cn.tyf.service.imp.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DeviceController {

    @Autowired
    private DeviceService deviceService;

    @Autowired
    private ConstAutoConfig constAutoConfig;

    @GetMapping("/setMinValue/{min}")
    @ResponseBody
    public boolean monitorWater(@PathVariable("min") double min){
        deviceService.setMin(min);
        return true;
    }
}
